home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 9494 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  719 b 

  1. Path: news.mty.itesm.mx!academ10!al522331
  2. From: al522331@academ10.mty.itesm.mx (RAFAEL ALGARA TORRE)
  3. Newsgroups: comp.lang.c++
  4. Subject: C++
  5. Date: 1 Mar 1996 17:44:53 GMT
  6. Organization: ITESM Campus Monterrey . DINF-DTCI
  7. Message-ID: <4h7d2l$jqt@news.mty.itesm.mx>
  8. NNTP-Posting-Host: 131.178.2.172
  9. X-Newsreader: TIN [version 1.2 PL2]
  10.  
  11.  If you have experience in any other language,
  12. there won't be a big difference, I think something
  13. like this will do for you:
  14.  
  15.  
  16. unsigned int factorial (int a)
  17. { if (a==0) factorial=1 
  18.   else factorial=a*factorial(n-1); }
  19.  
  20. --
  21.  
  22.  
  23. ------------------------------------------
  24. Rafael Algara Torre
  25. ITESM Monterrey, Mexico
  26. al522331@academ01.mty.itesm.mx
  27. ------------------------------------------
  28.